package cn.yogehaoren.badfox.spring.boot;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author WangNing yogehaoren@gamil.com <br>
 * @since 1.0
 */
@ConfigurationProperties(prefix="bad.fox")
public class BadFoxProperties {

    /**
     * 开启爬虫
     */
    private boolean enabled;

    /**
     * 开启分布式 Redission
     */
    private boolean enableRedissonQueue;

    private long bloomFilterExpectedInsertions;
    private double bloomFilterFalseProbability;

    /**
     * 线程数
     */
    private long threadPoolSize   = -1;


    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }



    public boolean isEnableRedissonQueue() {
        return enableRedissonQueue;
    }

    public void setEnableRedissonQueue(boolean enableRedissonQueue) {
        this.enableRedissonQueue = enableRedissonQueue;
    }

    public long getBloomFilterExpectedInsertions() {
        return bloomFilterExpectedInsertions;
    }

    public void setBloomFilterExpectedInsertions(long bloomFilterExpectedInsertions) {
        this.bloomFilterExpectedInsertions = bloomFilterExpectedInsertions;
    }

    public double getBloomFilterFalseProbability() {
        return bloomFilterFalseProbability;
    }

    public long getThreadPoolSize() {
        return threadPoolSize;
    }

    public void setThreadPoolSize(long threadPoolSize) {
        this.threadPoolSize = threadPoolSize;
    }

    public void setBloomFilterFalseProbability(double bloomFilterFalseProbability) {
        this.bloomFilterFalseProbability = bloomFilterFalseProbability;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("enabled", enabled)
                .append("threadPoolSize", threadPoolSize)
                .append("enableRedissonQueue", enableRedissonQueue)
                .append("bloomFilterExpectedInsertions", bloomFilterExpectedInsertions)
                .append("bloomFilterFalseProbability", bloomFilterFalseProbability)
                .toString();
    }



}
